package com.example.zuoye1023.utils

import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit

object HttpUtils {
    val client= OkHttpClient().newBuilder()
        .addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))

        .retryOnConnectionFailure(true)
        .callTimeout(1, TimeUnit.MINUTES)
        .build()

    val retrofit= Retrofit.Builder()
        .baseUrl("http://10.161.9.80:7012/")
        .addConverterFactory(GsonConverterFactory.create())
        .client(client)
        .build()

    val apiSeriver= retrofit.create(ApiSeriver::class.java)


}